import {listEmployee} from "@/api/cmdb/employee";

const employee = {
  state: {
    employees: [],
    employeeTotal: '',
  },

  mutations: {
    SET_EMPLOYEE: (state, response) => {
      state.employees = response.rows
      state.employeeTotal = response.total
    },
  },

  actions: {
    /** 查询employee列表列表 */
    GetEmployeeList({ commit ,state}) {
      listEmployee().then(response => {
        commit('SET_EMPLOYEE',response)
      });
    },
  }
}

export default employee
